﻿using Ardalis.Specification;
using Common.Utils;
using Domain.Entities.Organizations;

namespace Application.Features.Organizations.Specifications;

public class OrganizationSpec : Specification<Organization>
{
    public OrganizationSpec(OrganizatioAdvancedFilter filter)
    {
        Query.Where(x => x.OrganizationName == filter.OrganizationName, !filter.OrganizationName?.IsNullOrWhiteSpace() ?? false)
             .Where(x => x.IsActive == filter.IsActive, filter.IsActive.HasValue);
    }
}
 